using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class so_gal_farebasisMap : EntityTypeConfiguration<so_gal_farebasis>
    {
        public so_gal_farebasisMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.SectionString)
                .HasMaxLength(500);

            this.Property(t => t.SECTION_LABEL)
                .IsFixedLength()
                .HasMaxLength(3);

            this.Property(t => t.FARE_SECTION_ID)
                .IsFixedLength()
                .HasMaxLength(2);

            this.Property(t => t.Segment_Number)
                .IsFixedLength()
                .HasMaxLength(2);

            this.Property(t => t.FARE_BASIS_CODE)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.SEGMENT_VALUE)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.NOT_VALID_BEFORE_DATE)
                .IsFixedLength()
                .HasMaxLength(7);

            this.Property(t => t.NOT_VALID_AFTER_DATE)
                .IsFixedLength()
                .HasMaxLength(7);

            this.Property(t => t.SEGMENT_TICKET_DESIGNATOR)
                .IsFixedLength()
                .HasMaxLength(6);

            this.Property(t => t.ENDORSEMENT_ID_E_)
                .IsFixedLength()
                .HasMaxLength(2);

            this.Property(t => t.ENDORSEMENT)
                .IsFixedLength()
                .HasMaxLength(60);

            // Table & Column Mappings
            this.ToTable("so_gal_farebasis");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.reference).HasColumnName("reference");
            this.Property(t => t.SectionString).HasColumnName("SectionString");
            this.Property(t => t.MIR).HasColumnName("MIR");
            this.Property(t => t.SECTION_LABEL).HasColumnName("SECTION LABEL");
            this.Property(t => t.FARE_SECTION_ID).HasColumnName("FARE SECTION ID");
            this.Property(t => t.Segment_Number).HasColumnName("Segment Number");
            this.Property(t => t.FARE_BASIS_CODE).HasColumnName("FARE BASIS CODE");
            this.Property(t => t.SEGMENT_VALUE).HasColumnName("SEGMENT VALUE");
            this.Property(t => t.NOT_VALID_BEFORE_DATE).HasColumnName("NOT VALID BEFORE DATE");
            this.Property(t => t.NOT_VALID_AFTER_DATE).HasColumnName("NOT VALID AFTER DATE");
            this.Property(t => t.SEGMENT_TICKET_DESIGNATOR).HasColumnName("SEGMENT TICKET DESIGNATOR");
            this.Property(t => t.ENDORSEMENT_ID_E_).HasColumnName("ENDORSEMENT ID E:");
            this.Property(t => t.ENDORSEMENT).HasColumnName("ENDORSEMENT");
        }
    }
}
